//------------------------------------------------------------------------------
//  ServiceB Example for ProMRDS
//------------------------------------------------------------------------------

using Microsoft.Ccr.Core;
using Microsoft.Dss.Core.Attributes;
using Microsoft.Dss.ServiceModel.Dssp;
using System;
using System.Collections.Generic;
using W3C.Soap;
using serviceb = Robotics.ServiceB;


namespace Robotics.ServiceB
{
    /// <summary>
    /// ServiceB Contract class
    /// </summary>
    public sealed class Contract
    {
        /// <summary>
        /// The Dss Service contract
        /// </summary>
        public const String Identifier = "http://schemas.tempuri.org/2008/01/serviceb.html";
    }
    
    /// <summary>
    /// The ServiceB State
    /// </summary>
    [DataContract()]
    public class ServiceBState
    {
        private int _interval;
        [DataMember]
        public int Interval
        {
            get { return _interval; }
            set { _interval = value; }
        }
        [DataMember]
        public int SensorValue;
    }
    
    /// <summary>
    /// ServiceB Main Operations Port
    /// </summary>
    [ServicePort()]
    public class ServiceBOperations : PortSet<DsspDefaultLookup, DsspDefaultDrop, Get, SetInterval>
    {
    }
    
    /// <summary>
    /// ServiceB Get Operation
    /// </summary>
    public class Get : Get<GetRequestType, PortSet<ServiceBState, Fault>>
    {
        
        /// <summary>
        /// ServiceB Get Operation
        /// </summary>
        public Get()
        {
        }
        
        /// <summary>
        /// ServiceB Get Operation
        /// </summary>
        public Get(Microsoft.Dss.ServiceModel.Dssp.GetRequestType body) : 
                base(body)
        {
        }
        
        /// <summary>
        /// ServiceB Get Operation
        /// </summary>
        public Get(Microsoft.Dss.ServiceModel.Dssp.GetRequestType body, Microsoft.Ccr.Core.PortSet<ServiceBState,W3C.Soap.Fault> responsePort) : 
                base(body, responsePort)
        {
        }
    }

    /// <summary>
    /// ServiceB Set Interval Operation
    /// </summary>
    public class SetInterval: Update<SetIntervalRequest, PortSet<DefaultUpdateResponseType,Fault>>
    {
        public SetInterval()
        {
        }
    }

    /// <summary>
    /// Set Interval Request
    /// </summary>
    [DataContract]
    [DataMemberConstructor]
    public class SetIntervalRequest
    {
        [DataMember, DataMemberConstructor]
        public int Interval;
    }

}
